import { createRouter, createWebHistory, RouteRecordRaw } from "vue-router";

// 路由类型:RouteRecordRaw
const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    redirect: '/home',
  },
  {
    path: "/home",
    name: 'Home',
    component: () => import("@/views/Home/index.vue"),
  },
  {
    path: "/playDetail",
    name: 'PlayDetail',
    component: () => import("@/views/PlayDetail/index.vue"),
  },
  {
    path: "/songDetail",
    name: 'SongDetail',
    component: () => import("@/views/SongDetail/index.vue"),
  },
  {
    path: "/login",
    name: 'Login',
    component: () => import("@/views/Login/index.vue"),
  }
];

const router = createRouter({
  // 路由模式
  history: createWebHistory(),
  routes,
});

export default router;